import { createRouter, createWebHashHistory } from 'vue-router'
import Life from '@/view/Life.vue'
import TodoList from '@/view/TodoList.vue'
import ComParentToSon from '@/view/ComParentToSon.vue'
const routes = [
	{
		path: '/',
		component: ComParentToSon,
	},
	{
		path: '/life',
		component: Life,
	},
	{
		path: '/todolist',
		component: TodoList,
	},
	{
		path: '/watch',
		component: () => import('@/view/WatchComputed.vue'),
	},
]
/**
 * 创建路由对象
 *   history: 路由模式  hash模式，history模式
 *   routers: 路由规则
 *              url: path  <->  组件component 映射
 */
const router = createRouter({
	history: createWebHashHistory(),
	routes,
})

//暴露 commonjs
// es6模块化规则
export default router
